package com.weight.system.equmtgrp.service.impl;

import com.weight.system.equmtgrp.PO.EqumtgrpInfo;
import com.weight.system.equmtgrp.service.EqumtgrpInfoService;
import com.weight.system.equmtgrp.DAO.EqumtgrpInfoMapper;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import org.springframework.transaction.annotation.Transactional;
import com.weight.common.util.CommonUtils;
import lombok.extern.slf4j.Slf4j;

/**
 * 设备管理表
 */
@Service
@Transactional
@Slf4j
public class EqumtgrpInfoServiceImpl implements EqumtgrpInfoService {

	@Autowired
	private EqumtgrpInfoMapper equmtgrpInfoMapper;


	/**
	 * 查询设备管理信息--条件查询
	 * @param map
	 * @return
	 */
	@Override
	public List<EqumtgrpInfo> findEqumtgrpInfoByT(Map map){
		return equmtgrpInfoMapper.findEqumtgrpInfoByT(map);
	}

	/**
	 * 查询设备管理信息--条件，分页查询
	 * @param currentPage
	 * @param pageSize
	 * @param map
	 * @return
	 */
	@Override
	public List<EqumtgrpInfo> findEqumtgrpInfoByPage(int currentPage,int pageSize,Map map){
		PageHelper.startPage(currentPage, pageSize);
		List<EqumtgrpInfo> equmtgrpInfoList = equmtgrpInfoMapper.findEqumtgrpInfoByT(map);
		return equmtgrpInfoList;
	}

	/**
	 * 查询设备管理信息--查询全部
	 * @return
	 */
	@Override
	public List<EqumtgrpInfo> findAll(){
		return equmtgrpInfoMapper.findAll();
	}

	/**
	 * ID查询设备管理信息
	 * @param map
	 * @return
	 */
	@Override
	public EqumtgrpInfo findByEqumtgrpInfoId(Map map){
		EqumtgrpInfo equmtgrpInfo=equmtgrpInfoMapper.findByEqumtgrpInfoId(map);
		CommonUtils.validateExistObj(equmtgrpInfo,map);
		return equmtgrpInfo;
	}

	/**
	 * ID查询设备管理信息-批量
	 * @param equmtgrpInfoIdList
	 * @return
	 */
	@Override
	public List findByEqumtgrpInfoIdList(List equmtgrpInfoIdList){
		List idList = equmtgrpInfoMapper.findByEqumtgrpInfoIdList(equmtgrpInfoIdList);
		CommonUtils.validateExistList(idList,equmtgrpInfoIdList);
		return idList;
	}

	/**
	 * 添加设备管理
	 * @param equmtgrpInfo
	 */
	@Override
	public void insertEqumtgrpInfo(EqumtgrpInfo equmtgrpInfo){
		equmtgrpInfoMapper.insertEqumtgrpInfo(equmtgrpInfo);
	}

	/**
	 * 批量添加设备管理
	 * @param equmtgrpInfoList
	 */
	@Override
	public void insertEqumtgrpInfoBatch(List<EqumtgrpInfo> equmtgrpInfoList){
		equmtgrpInfoMapper.insertEqumtgrpInfoBatch(equmtgrpInfoList);
	}

	/**
	 * 修改设备管理
	 * @param equmtgrpInfo
	 */
	@Override
	public void updateEqumtgrpInfo(EqumtgrpInfo equmtgrpInfo){
		equmtgrpInfoMapper.updateEqumtgrpInfo(equmtgrpInfo);
	}

	/**
	 * 修改设备管理
	 * @param equmtgrpInfo
	 */
	@Override
	public void updateEqumtgrpInfoLimt(EqumtgrpInfo equmtgrpInfo){
		equmtgrpInfoMapper.updateEqumtgrpInfoLimt(equmtgrpInfo);
	}

	/**
	 * 物理删除设备管理
	 * @param map
	 */
	@Override
	public void deleteByEqumtgrpInfoId(Map map){
		equmtgrpInfoMapper.deleteByEqumtgrpInfoId(map);
	}

	/**
	 * 批量物理删除设备管理
	 * @param equmtgrpInfoIdList
	 */
	@Override
	public void deleteByEqumtgrpInfoIdBatch(List equmtgrpInfoIdList){
		equmtgrpInfoMapper.deleteByEqumtgrpInfoIdBatch(equmtgrpInfoIdList);
	}

	/**
	 * 状态删除设备管理
	 * @param map
	 */
	@Override
	public void upDelByEqumtgrpInfoId(Map map){
		equmtgrpInfoMapper.upDelByEqumtgrpInfoId(map);
	}

	/**
	 * 批量状态删除设备管理
	 * @param equmtgrpInfoList
	 */
	@Override
	public void upDelByEqumtgrpInfoIdBatch(Map<String, Object> map){
		equmtgrpInfoMapper.upDelByEqumtgrpInfoIdBatch(map);
	}

}